<?php

namespace App\Jobs;

use App\Events\UserCommand;
use App\Facades\DeviceService;
use App\Jobs\Job;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Bus\SelfHandling;
use Illuminate\Contracts\Queue\ShouldQueue;

class SendHeartBeat extends Job implements SelfHandling, ShouldQueue
{
    use InteractsWithQueue, SerializesModels;

    private $_fd;

    /**
     * Create a new job instance.
     *
     * @return void
     */
    public function __construct($fd)
    {
        $this->_fd = $fd;
    }

    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle()
    {
        DeviceService::sendHeartBeatData($this->_fd);
    }
}
